package com.suneee.refund.service;

import java.util.Map;

import com.suneee.context.page.Page;
import com.suneee.refund.bean.Condition;
import com.suneee.refund.bean.ViewRefundApplyWrap;
import com.suneee.refund.entity.RefundApply;
import com.suneee.refund.entity.RefundCheckInfo;
import com.suneee.trades.entity.Shopp;
import com.suneee.trades.entity.TradesInfo;
import com.suneee.trades.entity.TradesOrder;

public interface RefundApplyService {

	/**
	 * 订单退款列表
	 * @param condition 条件
	 * @param type 类型：退款、退货
	 * @return
	 */
	public Page<ViewRefundApplyWrap> getRefundApplysByCondition(Condition condition,String type);
	
	/**
	 * 订单退款详情
	 * @param refundApply 包含退款申请单id
	 * @return
	 */
	public RefundApply getRefundApply(RefundApply refundApply);
	
	/**
	 * 客服审批退款单
	 * @param refundApply 需要审核的退款申请单
	 */
	public void doVerify(RefundApply refundApply);
	
	/**
	 * 加载结束退货页面
	 * @param refundApply 包含退款申请单id
	 * @return
	 */
	public RefundApply getEndRefundPage(RefundApply refundApply);
	
	/**
	 * 通知财务退款
	 * @param refundApply 包含退款申请单id
	 */
	public void doRefundNotice(RefundApply refundApply);
	
	/**
	 * 客服结束退货
	 * @param refundApply 包含申请单号的对象
	 */
	public void doEndRefund(RefundApply refundApply);
	
	/**
	 * 仓库人员回填退货信息并验货
	 * @param checkedInfo 包含仓库反馈信息的对象
	 */
	public void doGoodsValidate(RefundCheckInfo checkedInfo);
	
	/**
	 * 获得验收结果所有状态
	 * @return
	 */
	public Map<String,String> getCheckResultMap();
	
	/**
	 * 客户审批，通知仓库，并生成换货审批单
	 * @param refundApply 包含换货审批单信息的对象
	 */
	public void doVerifyChangeGoods(RefundApply refundApply);
	
	/**
	 * 结束换货
	 * @param refundApply 包含换货单号的申请单对象
	 */
	public void doEndChangeGoods(RefundApply refundApply);
	
	/**
	 * 仓库人员回填换货信息并生成发货单
	 * @param refundId 换货单id
	 * @param shopp 仓库人员填写的发货单
	 */
	public void doGoodsChange(String refundId,Shopp shopp);
	
	public void jobOpen();
	
	/**
	 * 获取待处理的退款单
	 * @param condition
	 * @return
	 */
	public Page<ViewRefundApplyWrap> getNotRefundApplys(Condition condition);
	
	/**
	 * 获取处理成功的退款单
	 * @param condition
	 * @return
	 */
	public Page<ViewRefundApplyWrap> getRefundedApplys(Condition condition);
	
	/**
	 * 财务同意退款
	 * @param condition
	 */
	public void doAgreeRemit(RefundApply refundApply);
	
	/**
	 * 财务拒绝退款
	 * @param condition
	 */
	public void doRefuseRemit(RefundApply refundApply);
	
	/**
	 * 查询需要换货订单申请信息
	 * @param tid 交易单号（目前只有天猫）
	 * @return
	 */
	public TradesInfo getChangeGoodsOrder(String tid);
	
	/**
	 * 查询需要换货订单详情
	 * @param oid 子交易单号
	 * @return
	 */
	public TradesOrder getTradeOrder(String oid,Integer skuId,String orderId);
	
	/**
	 * 获得店铺的链接信息
	 * @param shopId
	 * @return
	 */
	public Map<String,String> getShopMap(Integer shopId);
	
	/**
	 * 财务同意退款(退货使用)
	 * @param condition
	 */
	public void cwDoAgreeRefundGoods(RefundApply refundApply);
	
	/**
	 * 
	 * @param refundApply
	 * @return
	 */
	public Boolean tmallAgreeRefundApply(RefundApply refundApply);
	
	/**
	 * 更新外部商城库存
	 * @param params
	 * @throws Exception
	 */
	public void updateOutStoreStock(Map<String,Object> params) throws Exception;
	
	/**
	 * 售后订单退款-发货接口
	 * @param tId 交易订单id
	 * @param refundId 售后订单号id
	 */
	public void updateRefundTradesInfo(String tId,String refundId,String description);
}
